﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Test.BLL;

namespace Test.UI
{
    public partial class StuInfoUI : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GridView1.DataSource = StuInfoBLL.Select();
            GridView1.DataBind();
        }

        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int id = Convert.ToInt32(e.Keys["Id"]);
            int num = StuInfoBLL.Delete(id);
            if (num > 0)
            {
                GridView1.DataSource = StuInfoBLL.Select();
                GridView1.DataBind();
            }
        }
    }
}